home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / 000176_amos-request@svcs1.digex.net_Mon Apr 21 09:38:23 1997.msg < prev    next >
Text File  |  1998-06-24  |  4KB  |  86 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail2.access.digex.net (8.8.5/8.8.5) with ESMTP id JAA17724
  3.     for <mcox@access.digex.net>; Mon, 21 Apr 1997 09:38:22 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id HAA27413
  6.     for amos-out; Mon, 21 Apr 1997 07:06:21 -0400 (EDT)
  7. Received: from mail3.access.digex.net (mail3.access.digex.net [205.197.247.4])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id HAA27410
  9.     for <amos-list@svcs1.digex.net>; Mon, 21 Apr 1997 07:06:20 -0400 (EDT)
  10. Received: from cpt6.stm.tudelft.nl (cpt6.stm.tudelft.nl [130.161.247.6])
  11.     by mail3.access.digex.net (8.8.5/8.8.5) with SMTP id HAA05436
  12.     for <amos-list@access.digex.net>; Mon, 21 Apr 1997 07:06:19 -0400 (EDT)
  13. Message-Id: <199704211106.HAA05436@mail3.access.digex.net>
  14. Received: by cpt6.stm.tudelft.nl
  15.     (1.38.193.4/16.2) id AA27466; Mon, 21 Apr 1997 13:04:32 +0200
  16. From: "Maarten D. de Jong" <dejong@cpt6.stm.tudelft.nl>
  17. Subject: Re: AMOS and ASM
  18. To: amos-list@access.digex.net
  19. Date: Mon, 21 Apr 97 13:04:32 METDST
  20. In-Reply-To: <861602189.0526764.0@h143.redrose.net>; from "Mush" at Apr 21, 97 2:25 am
  21. Mailer: Elm [revision: 70.85]
  22. Status: RO
  23. X-Status: 
  24.  
  25. > Ive managed to get a copy of devPac, and am not sure on how to integrate any
  26. > kind of assembler into AMOS. Someone did explain the basics of Dreg to me,
  27. > but I still dont quite get it.
  28.  
  29. It's basically very simple. You first need to code something in PC-relative
  30. code. That means that stuff like jsr and jmp are out of the question; in-
  31. structions like 'lea Data, a3' should be coded as 'lea Data(pc), a3'. If
  32. you neglect these requirements you'd better make sure you have your ticket
  33. to India handy. Your code should also be one segment. Finally, Devpac is
  34. not capable of writing out raw code, it always wraps a set of hunks around
  35. your code. You need to remove these hunks manually before you load the code
  36. into AMOS. (It's not hard, if you stick to PC-relative code and 1 code
  37. segment, you just need to remove the first 32 bytes and the last 4 bytes.)
  38.  
  39. Of course, you can circumvent these problems, but then you need to call
  40. on LoadSeg() to load your code into memory. I have never tried this, but
  41. I see no reason why this should fail. 
  42.  
  43. Lets assume an example:
  44.  
  45.     addq.l #8, d1
  46.      rts
  47.  
  48. This code adds 8 to the register d1. You can Poke the code into memory your-
  49. self, it's just four bytes. I've assumed this is done in bank 10. Next you
  50. program in AMOS:
  51.  
  52.     Dreg(1)=100
  53.     Call Start(10)
  54.     RESULT=Dreg(1)    
  55.  
  56. which should yield 108 as the answer. I've forgotten whether 'call' is the
  57. right instruction, but you probably get the idea. First you setup d1 to
  58. contain 100, then you call your small program. That simply adds 8 to what-
  59. ever is stored in d1, and then returns. AMOS then reads what is inside
  60. d1 -- 108. 
  61.  
  62. Using this technique, I've written a small program which converts AMOS'
  63. FFP numbers into IEEE-compliant ones; I could then use my FPU from within
  64. AMOS 1.36. It's not easy to do (AMOS Pro solved this problem on a much
  65. better level) but it worked!
  66.  
  67. > Can someone send me an ASM program, which can be merged into AMOS, and
  68. > explain to me how to use it. I would like to write an ASM version of ZOOM,
  69. > and would be interested in routines which will draw onto the screen, or draw
  70. > to mem for a c2p routine.
  71.  
  72. There are plenty of asm-c2p routines available on Aminet; if you change
  73. the screen base to point to the memory region where AMOS stores the bitplanes
  74. you're in business. I believe it's Screen Base or Phybase which gives you
  75. the required addresses. There was a special demo on the Amos Classic Compiler
  76. disk illustrating a certain effect programmed with ML. You should take a look
  77. at this.
  78.  
  79. However, if you are not familiar with assembly language, I'd advise you to
  80. study that first. There is no point in messing with it if you don't know
  81. the limitations and possibilities.
  82.  
  83. Hope this helps a bit,
  84. Maarten
  85.